<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>全球商业联盟通用积分促销实时交易结算数据中心</title>
    <link href="__CSS__/bootstrap.css?v=3.3.7" rel="stylesheet">
    <link href="__JS__/plugins/layui/css/layui.css" rel="stylesheet">
    <style>
        html, body {
            height: 100%;
        }

        body {
            background-color: #000000;
            margin: 0;
            font-family: Helvetica, sans-serif;;
            overflow: hidden;
        }
        #info {
            position: absolute;
            width: 100%;
            color: rgba(127,255,255,0.75);
            padding: 5px;
            font-family: Monospace;
            font-size: 34px;
            font-weight: bold;
            text-align: center;
            z-index: 1;
            margin-top:10px;
        }
        #msg{
            position: absolute;
            width: 100%;
            color: #FB7A29;
            padding: 5px;
            font-family: Monospace;
            font-size: 24px;
            font-weight: bold;
            text-align: center;
            z-index: 1;
            margin-top:60px;
        }

        #logo {
            position: absolute;
            width: 100%;
            padding: 10px;
            text-align: left;
            z-index: 1;
        }
        #logo img{
            width:90px;
            height:90px;
            /*object-fit: cover;*/
        }
        #logo span{
            display: inline-block;
            color:#FB7A29;
            font-size: 40px;
        }
        .layui-table[lay-even] tr:nth-child(even){
            background-color: #4772a9;
        }
        .layui-table[lay-even] tr:nth-child(odd){
            background-color: #000000;
        }
        .layui-table-view{
            border-width: 0px;
            border-style: none;
            border-color: #e6e6e6;
        }
        .layui-table-header {
            border-width: 0 0 0px;
        }
        .table-img {
            width: 25px;
            height: 25px;
            cursor: pointer;
            object-fit: cover;
        }
        .layui-table-header{
            background-color: transparent;
        }
        .layui-table-view .layui-table td, .layui-table-view .layui-table th{
            padding:1px 0px;
        }
    </style>
</head>
<body>
<div id="logo">
    <div style="float:left;">
        <img src="/static/admin/images/jf2.png"  >
    </div>
    <div style="float:left;margin-left:10px;text-align: center">
        <span></span><br>
        <span style="font-size:25px;"></span>
    </div>
</div>
<div id="info">全球商业联盟通用积分促销实时交易结算数据中心</div>
<div id="msg">
    <span style="display: inline-block;margin-right: 20px;">今日新增会员人数：<span style="font-size:32px;font-weight: bold;" id="new">{$new}</span>（人）</span>
    <span style="display: inline-block;margin-right: 20px;">今日交易额：<span style="font-size:32px;font-weight: bold;" id="sum">{$sum}</span>（积分）</span>
    <span>会员总数：<span style="font-size:32px;font-weight: bold;" id="member">{$member}</span>（人）</span>
</div>
<div class="col-sm-12" style="height:700px;margin-top:125px;padding:0px;">
    <table class="layui-hide" id="test" lay-filter="demo"></table>
	<script type="text/html" id="user_username">
                        {{# if(d.user_username.substr(0,1) == 1 && d.user_username.length == 11){ }}
                            {{d.user_username.substr(0,3)}}****{{d.user_username.substr(7,4)}}
                        {{# }else{ }}
                            {{d.user_username}}
                        {{# } }}
                    </script>
    <script type="text/html" id="imgTpl">
        <img src="{{d.user_image}}" class="img-circle table-img" onerror="this.src='/static/admin/images/head_default.gif'"  />
    </script>
</div>
<script src="__JS__/jquery.min.js"></script>
<script src="__JS__/plugins/layui/layui.js"></script>
<script>
    $.ajaxSetup({ cache: false });
    layui.use('table', function () {
        var table = layui.table
            , form = layui.form;
        table.render({
            elem: '#test'
            , url: '{:url("Center/index3")}'
            ,response: {
                statusCode: 220
            }
            , where:{t:new Date().getTime()}
            , page: false
            , skin: 'nob'
            //, size: 'lg'
            , even: true
            , loading: false
            , id: 'testReload'
            , cols: [[
                {field: 'user_image', width: '', title: '用户头像', align: 'center', templet: '#imgTpl'}
                , {field: 'user_username', width: '', title: '用户名', align: 'center', templet: '#user_username'}
                , {field: 'o_jifen', width: '', title: '积分兑换', align: 'center'}
                , {field: 'goods_name', width: '', title: '商品名称', align: 'center'}
                , {field: 'shop_name', width: '', title: '商家名称', align: 'center'}
                , {field: 'district', width: '', title: '所属城市', align: 'center'}
                , {field: 'commission', width: '', title: '产生佣金', align: 'center'}
                , {field: 'partner', width: '', title: '合伙人收益', align: 'center'}
            ]],
            done:function (res, curr, count) {
                $('th').children().css({'font-weight': 'bold', 'font-size': '22px', 'color': '#86ffff','background':'#4772a9'});
                $('th').css({'background':'#375EA6'});
                $('tr').children().css({'font-weight': 'bold', 'color': '#86ffff'});
                var iCount = setInterval(function () {
                    table.reload('testReload',{
                        url:'{:url("Center/index3")}'
                        ,where:{t:new Date().getTime()}
                        ,page: {
                            curr: 1
                        }
                    });
                    $.ajax({
                        url:"/admin/center/flush",
                        type:"get",
                        dataType:"json",
                        success:function (res) {
                            $("#new").text(res.msg.new)
                            $("#sum").text(res.msg.sum)
                            $("#member").text(res.msg.member)
                        }
                    })
                    clearInterval(iCount);
                },5000)
            }
        });
    });
</script>
</body>
</html>